# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.VMwareEngine.V1.Model.Cluster do
  @moduledoc """
  A cluster in a private cloud.

  ## Attributes

  *   `autoscalingSettings` (*type:* `GoogleApi.VMwareEngine.V1.Model.AutoscalingSettings.t`, *default:* `nil`) - Optional. Configuration of the autoscaling applied to this cluster.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Creation time of this resource.
  *   `management` (*type:* `boolean()`, *default:* `nil`) - Output only. True if the cluster is a management cluster; false otherwise. There can only be one management cluster in a private cloud and it has to be the first one.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Identifier. The resource name of this cluster. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster`
  *   `nodeTypeConfigs` (*type:* `%{optional(String.t) => GoogleApi.VMwareEngine.V1.Model.NodeTypeConfig.t}`, *default:* `nil`) - Required. The map of cluster node types in this cluster, where the key is canonical identifier of the node type (corresponds to the `NodeType`).
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the resource.
  *   `stretchedClusterConfig` (*type:* `GoogleApi.VMwareEngine.V1.Model.StretchedClusterConfig.t`, *default:* `nil`) - Optional. Configuration of a stretched cluster. Required for clusters that belong to a STRETCHED private cloud.
  *   `uid` (*type:* `String.t`, *default:* `nil`) - Output only. System-generated unique identifier for the resource.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Last update time of this resource.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :autoscalingSettings => GoogleApi.VMwareEngine.V1.Model.AutoscalingSettings.t() | nil,
          :createTime => DateTime.t() | nil,
          :management => boolean() | nil,
          :name => String.t() | nil,
          :nodeTypeConfigs =>
            %{optional(String.t()) => GoogleApi.VMwareEngine.V1.Model.NodeTypeConfig.t()} | nil,
          :state => String.t() | nil,
          :stretchedClusterConfig =>
            GoogleApi.VMwareEngine.V1.Model.StretchedClusterConfig.t() | nil,
          :uid => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:autoscalingSettings, as: GoogleApi.VMwareEngine.V1.Model.AutoscalingSettings)
  field(:createTime, as: DateTime)
  field(:management)
  field(:name)
  field(:nodeTypeConfigs, as: GoogleApi.VMwareEngine.V1.Model.NodeTypeConfig, type: :map)
  field(:state)
  field(:stretchedClusterConfig, as: GoogleApi.VMwareEngine.V1.Model.StretchedClusterConfig)
  field(:uid)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.VMwareEngine.V1.Model.Cluster do
  def decode(value, options) do
    GoogleApi.VMwareEngine.V1.Model.Cluster.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.VMwareEngine.V1.Model.Cluster do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
